class MessageWidget extends StatelessWidget {
final String message;
final bool isMe;
MessageWidget({required this.message, required this.isMe});
@override
Widget build(BuildContext context) {
if (isMe) {
return Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(10)
),
child: Text(
message,
style: TextStyle(
color: Colors.white,
fontSize: 16
),
)
);
}
else {
return Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)
),
child: Text(
message,
style: TextStyle(
color: Colors.white,
fontSize: 16
),
)
);
}
}
}